<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <button>购买</button>
  <script src="http://127.0.0.1:3000/javascripts/jquery-3.4.1.min.js"></script>
  <script>
    $("button").click(function () {
      console.log(localStorage.token)
      $.ajax({
        url: "http://127.0.0.1:3000/users/buy",
        type: "post",
        dataType: "json",
        data: {
          token: localStorage.token
        },
        success: function (res) {
          console.log(res)
        }
      })



    })


  </script>
</body>

</html>